#include "tcpserver.hpp"
#include "log.hpp"
#include "inetaddr.hpp"
#include "threadpool.hpp"
using namespace ThreadPool;
using namespace hllog;
using namespace hladdr;
using fun_t = std::function<void()>;
int main(int argc, char *argv[])
{
    if (argc != 2)
    {
        std::cout << "usage : " << argv[0] << " port" << std::endl;
        exit(1);
    }
    uint16_t port = std::stoi(argv[1]);
    // 线程池
    std::unique_ptr<Threadpool<func_t>> tpl = std::make_unique<Threadpool<func_t>>();
    tpl->Start();
    // // TcpServer tsvr(port);
    // TcpServer tsvr(port,[&tpl](int fd,InetAddr& addr) ->std::string{
    //     auto b = bind(&tpl->Enqueue,tpl,fd,addr);

    // });
    // tsvr.Init();
    // tsvr.Start();
    return 0;
}